<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
  <style type="text/css">
	.layui-form .layui-form-item{
		width:90%;
	}
	</style>
</head>
<body style="margin-top: 10px">
<form class="layui-form" th:action="@{/}+'navi/add'">
<input type="hidden" name="parentId">
  <div class="layui-form-item">
    <label class="layui-form-label">菜单名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" lay-verify="required" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">URL</label>
    <div class="layui-input-block">
      <input type="text" name="url" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">图标</label>
    <div class="layui-input-block">
      <input type="text" name="icon" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-block">
      <input type="number" name="orderno" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">记录状态</label>
    <div class="layui-input-block">
      <select name="state" lay-filter='state'></select>
    </div>
  </div>
</form>
 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  createSelect("valid-state","state",form,5);
  //监听提交
  form.on('submit(form-submit)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
});
</script>
</body>
</html>